﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Audio;

namespace Platformer
{
    class Speech
    {
        Vector2 pos;
        Texture2D bubblePixel;
        List<string> whatToSay;

        public Speech(Vector2 position, string sayings)
        {
            pos = position;
            parse(sayings);
            whatToSay = new List<string>();
        }

        private void parse(string toParse)
        {
            if (toParse.Length > 64)
            {
                //Not done, this is what is needed, but for the entire string.
                string t = toParse.Substring(0, 64);
                int r = t.LastIndexOf(' ');
                whatToSay.Add(t.Substring(0,r));
            }
        }

        public void draw(SpriteBatch batch)
        {
            int stretch = whatToSay.Count * 11;
            //Second pos not correct....
            batch.Draw(bubblePixel, pos, null, Color.White, 0, pos, stretch, SpriteEffects.None, 10);
            
        }
    }
}
